﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.JShop.UI;
using CNVP.Framework.Utils;

using CNVP.Config;

namespace CNVP.JShop.Web.Admin
{
    public partial class Index : AdminPage
    {
        private string Prefix = DBConfig.Prefix;
        public int TopId = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            var list_topMenu = new BLL.BLLMenu().GetAll_CNVP_Menu("Depth=0 order by Weight");
            for (int i = 0; i < list_topMenu.Count; i++)
            {
                string userName = CookieString;
                int AdminRoleID = CookieRoleID;
                var menuList = new BLL.CNVP_Menu().GetAll_CNVP_Menu("Depth=" + list_topMenu[i].ID + " AND ID in (select MenuID from " + Prefix + "AdminRoleMenu where AdminRoleID=" + AdminRoleID + ") order by Weight");
                if (menuList.Count > 0)
                {
                    TopId = Convert.ToInt32(list_topMenu[i].ID);
                    break;
                }
            }
        }
        
    }
}